<?php

namespace app\common\model;
use think\Model;
use traits\model\SoftDelete;

class CarModel extends Model
{

	protected $pk = 'id';			//默认主键
	protected $table = 'car_model';	//
	use SoftDelete;
	protected $deleteTime = 'delete_time';
	
	protected $autoWriteTimestamp = true;
	protected $createTime = 'create_time';
	protected $updateTime = 'update_time';
	protected $dateFormat = 'Y年m月d日';
	
    public static function test()
    {	
    	$res = self::all(['pid' => 0]);
        

        foreach ($res as $key => $value) {
        	# code...
        	print_r($key ." ". $value->id . " " . $value->name . " " . $value->pid . '<br>');

        }

        // return $strr;
        // var_dump($res);
        // print_r($res . '<br>');
    }
	
}